<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
/*
	积分、余额日志
*/
defined('BY_JYA') or exit('error');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['list']=array();
	$return['params']['status']=0;
	set_html('title','消费金记录');
	exi($return);
}
if($_RQ['op']=='list'){
	$params=array('uniacid'=>$_SESSION['uniacid'],'cityid'=>$_SESSION['cityid']);
	$return['params']=array();
	$pindex = max(1, intval($_RQ['page']));
	if($_RQ['psize']){
		$return['params']['psize']=$_RQ['psize'];
	}
	$psize = $_RQ['psize']?:10;
	//时间范围
	if($_RQ['createtime']){
		$time_range=cfc('tools')->base64_decode($_RQ['createtime'],$_SESSION['base_key_str']);
		$time_range=json_decode($time_range,true);
		$return['params']['createtime']=$time_range;
		$params['createtime between']=array($time_range['tstart'],$time_range['tend']);
	}
	$list=$this->getslice('redlog',$params,array($pindex,$psize),$total,array(),'','id desc');
	foreach($list as &$item){
		$item['member']=cfc('core')->member_show($item['mid']);
		$item['createtime']=date('Y-m-d H:i:s',$item['createtime']);
	}
	$return['list']=$list?$list:array();
	exi($return);
}